package com.sam.kafka.consumer;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.common.TopicPartition;

import java.time.Duration;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: wm.xue
 * @date: 2021/11/29 9:34
 * @description: 订阅主题方式
 */
public class _07_Consumer_Sub_Topic {
    public static void main(String[] args) {
        Map<String, Object> configs = new HashMap<>();
        KafkaConsumer<String, String> consumer = new KafkaConsumer<String, String>(configs);

        // 方式1
//        consumer.subscribe(null);

        //  获取主题详细信息
//        consumer.partitionsFor(null);

        // 分配特定主题的特定分区
//        consumer.assign(null);

        // 获取分区偏移量
//        consumer.position(null);



    }
}
